#ifndef __VECTOR_IS_INCLUDED__
#define __VECTOR_IS_INCLUDED__

#define CO(V)	V.x,V.y,V.z
#define PI acos(-1.0)

struct Vector3d{
	double x,y,z;
	Vector3d();
	Vector3d(double,double,double);
	bool scan();
	double mag2();
	double mag();
	void norm();
	Vector3d unit();
	void show();
	void showln();
};

Vector3d operator+(Vector3d a,Vector3d b);
Vector3d operator-(Vector3d a);
Vector3d operator-(Vector3d a,Vector3d b);
Vector3d operator*(Vector3d a,Vector3d b);
Vector3d operator*(double a,Vector3d b);
Vector3d operator*(Vector3d b,double a);
Vector3d operator/(Vector3d b,double a);

double DOT(Vector3d a, Vector3d b);
Vector3d CROSS(Vector3d a, Vector3d b);
double BOX(Vector3d a, Vector3d b, Vector3d c);

double projectLength(Vector3d proj, Vector3d on);
Vector3d projectVector(Vector3d proj, Vector3d on);
Vector3d rotateVector(Vector3d rotatee, Vector3d axis, double angle);

//AS POINTS
double pointDistance(Vector3d p1,Vector3d p2);

extern Vector3d I;
extern Vector3d J;
extern Vector3d K;
extern Vector3d Origin;

#endif
